home *** CD-ROM | disk | FTP | other *** search
- -- card: 3878 from stack: in
- -- bmap block id: 0
- -- flags: 0000
- -- background id: 3803
- -- name:
- ----- HyperTalk script -----
- on idle
- put the number of buttons into x
- repeat with n = 1 to x
- show button n
- end repeat
- end idle
-
- on preview2 tempList,mealList,dataLines
- repeat with n = 1 to 5
- get line n of tempList
- put formatNum(it) into line n of cd field id 2
- get line (n + 22) of tempList
- put formatNum(it) into line (n+5) of cd field id 2
- end repeat
- get line 45 of tempList
- put formatNum(it) & return into line 10 of cd field id 2
- put mealList into cd field id 5
- put tempList into cd field id 8
- put dataLines & return into cd field 11
- repeat with n = 6 to 14
- get line n of tempList
- put formatNum(it) & return after cd field id 4
- end repeat
- repeat with n = 15 to 22
- get line n of tempList
- put formatNum(it) & return after cd field id 2
- end repeat
- end preview2
-
-
-
- -- part 1 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=21 top=90 right=333 bottom=126
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 2 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=125 top=90 right=333 bottom=195
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 3 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=269 top=132 right=260 bottom=392
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 4 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=391 top=132 right=260 bottom=463
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 65535
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 5 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=109 top=42 right=64 bottom=500
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name:
-
-
- -- part 6 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=397 top=274 right=300 bottom=498
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Select Food
- ----- HyperTalk script -----
- on mouseUp
- global valueHolder,mealList,sizeList,dataLines
- put cd field 1 of card id 9116 into container
- put " Select a category:" into prompt
- ShowDialog 7,5004,prompt,chicago,12,container,1,"one"
- if line 1 of the result is 2 then exit mouseUp
- put line 2 of the result into lineNum
- put line lineNum of container into cardName
- put empty into cd field id 2
- put empty into cd field id 4
- visual effect iris open
- orderfood cardName
- preview2 valueHolder,mealList,dataLines
- put empty into valueHolder
- put empty into mealList
- put empty into dataLines
- put sizeList*100 into cd field id 20
- put empty into sizeList
- end mouseUp
-
-
-
-
-
- -- part 7 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=399 top=307 right=330 bottom=497
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Exit
- ----- HyperTalk script -----
- on mouseUp
- put empty into cd field id 2
- put empty into cd field id 4
- put empty into cd field id 5
- put empty into cd field id 8
- put empty into cd field id 20
- put empty into cd field 11
- visual effect iris close slowly
- pop card
- end mouseUp
-
-
-
- -- part 8 (field)
- -- low flags: 81
- -- high flags: 2002
- -- rect: left=269 top=87 right=111 bottom=494
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 10
- -- style flags: 0
- -- line height: 13
- -- part name:
-
-
- -- part 9 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=283 top=274 right=299 bottom=389
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Calorie Profile
- ----- HyperTalk script -----
- on mouseUp
- if cd field id 2 is empty then
- play boing
- set the hilite of button id 6 to true
- answer "Select a food to analyze."
- set the hilite of button id 6 to false
- exit mouseUp
- end if
- put cd field 5 into name
- put cd field 6 into portion
- put 4*(line 1 of cd field id 2) into prot
- put 9*(line 2 of cd field id 2) into fat
- put 4*(line 3 of cd field id 2) into carb
- put 7*(line 10 of cd field id 2) into alc
- put 9*(line 7 of cd field id 2) into sat
- put prot + fat + carb + alc into totalcal
- put prot/totalcal into prot
- put fat/totalcal into fat
- put carb/totalcal into carb
- put alc/totalcal into alc
- put sat/totalcal into sat
- push card
- visual effect iris open slowly
- go cd id 20330
- set the textsize of field "Name" to 10
- set the textsize of field "Date" to 10
- put name into field "Name"
- put "Portion:" & return & portion into field "Date"
- plotpie prot,carb,fat,alc,sat
- end mouseUp
-
-
-
- -- part 10 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=284 top=307 right=330 bottom=388
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Fat Profile
- ----- HyperTalk script -----
- on mouseUp
- if cd field id 2 is empty then
- set the hilite of button id 6 to true
- play boing
- answer "Select a food to analyze."
- set the hilite of button id 6 to false
- exit mouseUp
- end if
- put cd field 5 into name
- put cd field 6 into portion
- put line 7 of cd field id 2 into sat
- put line 8 of cd field id 2 into mono
- put line 9 of cd field id 2 into poly
- put sat + mono + poly into total
- if total = 0 then
- play "boing"
- answer "Sorry, fat composition data not available here."
- exit mouseUp
- end if
- push card
- visual effect iris open slowly
- go cd id 22407
- set the textsize of field "Name" to 10
- set the textsize of field "Date" to 10
- put name into field "Name"
- put "Portion:" & return & portion into field "Date"
- plotFats sat,mono,poly,total
- end mouseUp
-
-
-
- -- part 11 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=340 top=10 right=32 bottom=420
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Print Data
- ----- HyperTalk script -----
- on mouseUp
- doPrint --Handler is in stack script
- end mouseUp
-
-
-
- -- part 14 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=21 top=71 right=91 bottom=195
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 16 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=269 top=113 right=133 bottom=463
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 19 (field)
- -- low flags: 01
- -- high flags: 2002
- -- rect: left=22 top=42 right=64 bottom=110
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 20 (field)
- -- low flags: 81
- -- high flags: 2002
- -- rect: left=269 top=67 right=88 bottom=369
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 3
- -- text size: 10
- -- style flags: 256
- -- line height: 13
- -- part name:
-
-
- -- part 21 (button)
- -- low flags: 00
- -- high flags: A004
- -- rect: left=311 top=74 right=103 bottom=428
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 1
- -- font id: 0
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: Add to Recipe
- ----- HyperTalk script -----
- on mouseUp
- Answer "Really add to your recipe now?" with "OK" or "Cancel"
- if it is "Cancel" then exit mouseUp
- get cd field id 8
- if it is empty then exit mouseUp
- set the cursor to 4
- put it into tempData -- data list in hidden field
- put cd field id 5 into theName --amount and item name for ingr list
- put cd field id 20 into theWt -- weight total in grams
- put line 1 of cd field 11 into dataLIne
- set the lockscreen to true
- go to card id 14317
- put theName after cd field id 2
- put field 2 into temp
- put addfields(tempData,temp) into field 2
- put dataLine & return after field 7
- put theWt & return after field 6
- put field 3 + theWt into field 3
- get field 3
- set the numberFormat to "0.#"
- put 0+it into cd field 7
- put it/28.35 into cd field 8
- go to card id 3878
- set the lockscreen to false
- answer "Item added to your recipe."
- end mouseUp
-
-
-
- -- part 22 (field)
- -- low flags: 81
- -- high flags: 0007
- -- rect: left=156 top=120 right=205 bottom=356
- -- title width / last selected line: 0
- -- icon id / first selected line: 0 / 0
- -- text alignment: 0
- -- font id: 3
- -- text size: 12
- -- style flags: 0
- -- line height: 16
- -- part name: dataLine
-
-
- -- part contents for card part 1
- ----- text -----
- Protein (g)
- Total Fat (g)
- Carb (g)
- Calories
- Fiber (g)
- Cholest (mg)
- Sat. Fat (g)
- Mono Fat (g)
- Poly Fat (g)
- Alcohol (g)
- Vit A (IU)
- Vit C (mg)
- Thiamin (mg)
- Riboflvn (mg)
- Niacin (mg)
- Vit B6 (mg)
- Folacin (µg)
- Vit B12 (µg)
-
- -- part contents for card part 3
- ----- text -----
- Calcium (mg)
- Iron (mg)
- Magnesium (mg)
- Phosphorus (mg)
- Potassium (mg)
- Sodium (mg)
- Zinc (mg)
- Copper (mg)
- Manganese (mg)
-
-
- -- part contents for background part 1
- ----- text -----
- Nutrient Profile
-
- -- part contents for card part 19
- ----- text -----
- Food Name:
-
- -- part contents for card part 14
- ----- text -----
- Amount per Portion
-
- -- part contents for card part 16
- ----- text -----
- Amount per portion